package com.google.gwt.vector.client.ui;

import com.google.gwt.user.client.Element;
import com.google.gwt.vector.client.Vector;

/**
 *
 */
public class Eclipse extends BasicShape {

  private double x;
  private double y;

  private double radiusX;
  private double radiusY;

  private Eclipse(Element elem) {
    super(elem);
  }

  public Eclipse(double coordinateX, double coordinateY, double radiusX,
      double radiusY) {
    this(Vector.createEclipse());
    this.setCoord(coordinateX, coordinateY);
    this.setRadius(radiusX, radiusY);
    setColor(Color.BLACK);
    setStrokeColor(Color.BLACK);
    setStrokeWidth(1);
  }

  public void setCoord(double coordinateX, double coordinateY) {
    this.x = coordinateX;
    this.y = coordinateY;
    Vector.setEclipseCoord(getElement(), x, y, radiusX, radiusY);
  }

  public void setRadius(double radiusX, double radiusY) {
    this.radiusX = radiusX;
    Vector.setRadius(getElement(), radiusX, radiusY);
    setCoord(x, y);
  }
}
